typedef unsigned int pte_t; 
#define ZEXT(x) ((unsigned int)(x))

#define PTE_U 0x10U
#define PTE_X 0x8U
#define PTE_W 0x4U
#define PTE_R 0x2U
#define PTE_V 0x1U

#define L1_PTE_INDEX(va) (ZEXT(ZEXT(va) & 0xFFC00000U) >> 22)
#define L2_PTE_INDEX(va) (ZEXT(ZEXT(va) & 0x3FF000U) >> 12)
#define PADDR_OFFSET(va) (ZEXT(ZEXT(va) & 0xFFFU))
//#define PG4K_MASK 0xFFFFF000U
#define PG4K_MASK 0xFFFU
#define FLAG_MASK 0xFFFU